<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="admin/_fragments::head(~{::title})">
    <meta charset="UTF-8">
    <title>博客管理页</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.10/semantic.min.css">
    <link rel="stylesheet" href="../../static/css/me.css">
</head>
<body>

<!--导航-->
<nav th:replace="admin/_fragments::menu(1)" class="ui inverted semantic segment">
    <div class="ui container">
        <div class="ui inverted secondary menu">
            <h3 class="ui teal inverted header item">管理后台</h3>
            <a href="#" class="item">
                <i class="home icon"></i>
                博客
            </a>
            <a href="#" class="item">
                <i class="lightbulb icon"></i>
                分类
            </a>
            <a href="#" class="item">
                <i class="tags icon"></i>
                标签
            </a>
            <div class="right menu">
                <div class="ui dropdown item">
                    <div class="text">
                        <img src="https://picsum.photos/100/100" alt="" class="ui avatar image">
                        罗小宝
                    </div>
                    <i class="dropdown icon"></i>
                    <div class="menu">
                        <a href="" class="item">注销</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</nav>

<!--中间部分-->
<div class="m-container m-padded-tb-large">
    <div class="ui container">
        <div class="ui secondary segment form">
            <input type="hidden" name="page">
            <div class="inline fields">
                <div class="field">
                    <input type="text" name="title" placeholder="标题">
                </div>
                <div class="field">
                    <div class="ui labeled action input">
                        <div class="ui type selection dropdown">
                            <i class="dropdown icon"></i>
                            <div class="default text">分类</div>
                            <div class="menu">
                                <div class="item" th:each="type : ${types}" data-value="1" th:data-value="${type.id}"
                                     th:text="${type.name}">错误日志
                                </div>
                            </div>
                        </div>
                    </div>
                    <button class="ui button">clear</button>
                </div>
                <div class="field">
                    <div class="ui checkbox">
                        <input type="checkbox" tabindex="0" class="hidden">
                        <label>推荐</label>
                    </div>
                </div>
                <div class="field">
                    <button type="button" class="ui mini teal basic button">
                        <i class="search icon"></i>
                        搜索
                    </button>
                </div>
            </div>
        </div>
        <div class="ui segment">
            <table class="ui celled table">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>标题</th>
                    <th>类型</th>
                    <th>推荐</th>
                    <th>状态</th>
                    <th>更新时间</th>
                    <th>操作</th>
                </tr>

                </thead>
                <tbody>
                <tr th:each="blog, iterStat : ${pageInfo.list}">
                    <td th:text="${iterStat.count}">1</td>
                    <td th:text="${blog.title}">测试1</td>
                    <td th:text="${blog.type.name}">认知升级</td>
                    <td th:text="${blog.recommend} ? '是' : '否'">是</td>
                    <td th:text="${blog.published} ? '发布' : '草稿'">发布</td>
                    <td th:text="${#dates.format(blog.updateTime, 'yyyy-MM-dd HH:mm')}">2021-02-11 12:16:20</td>
                    <td>
                        <a href="#" th:href="@{/admin/blogs/{id}/input(id=${blog.id})}"
                           class="ui teal basic button">编辑</a>
                        <a href="#" th:href="@{/admin/blogs/{id}/delete(id=${blog.id})}"
                           class="ui red basic button">删除</a>
                    </td>
                </tr>
                </tbody>
                <tfoot>
                <tr>
                    <th colspan="7">
                        <div class="ui mini pagination menu" th:unless="${pageInfo.pages} > 1">
                            <a href="" class="item" th:unless="${pageInfo.hasPreviousPage}">上一页</a>
                            <a href="" class="item" th:unless="${pageInfo.hasNextPage}">下一页</a>
                        </div>
                        <a href="#" th:href="@{/admin/input}" class="ui mini right floated teal basic button">新增</a>
                    </th>
                </tr>
                </tfoot>
            </table>
        </div>
    </div>
</div>

<br>
<br>
<br>

<!--底部-->
<footer th:replace="_fragments::footer" class="ui inverted vertical segment m-padded-tb-massive">
    <div class="ui center aligned container">
        <div class="ui inverted divided grid">
            <div class="three wide column">
                <div class="inverted link list">
                    <img src="../static/img/wechat.jpg" alt="" class="ui rounded image">
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header">最新博客</h4>
                <div class="ui inverted link list">
                    <a href="" class="item">用户故事(Story)</a>
                    <a href="" class="item">用户故事(Story)</a>
                    <a href="" class="item">用户故事(Story)</a>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header">联系我</h4>
                <div class="ui inverted link list">
                    <a href="#" class="item">1944303766@qq.com</a>
                </div>
                <div class="ui inverted link list">
                    <a href="#" class="item">QQ:1944303766</a>
                </div>
            </div>
            <div class="seven wide column">
                <h4 class="ui inverted header">Blog</h4>
                <p>这是我的个人博客、会分享关于编程、写作、思考相关的任何内容，希望可以给来到这儿的人有所帮助...</p>
            </div>
        </div>
        <div class="ui inverted section divider"></div>
        <p>Copyright© 2020-2021</p>

    </div>
</footer>

</body>
<!--/*/ <th:block th:replace="admin/_fragments::script"> /*/-->
<script src="../../static/js/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.10/semantic.min.js"></script>
<!--/*/ </th:block> /*/-->
<script>
    $('.ui.dropdown')
        .dropdown()
    ;

</script>
</html>